Conventionally, a PLC (Programmable Logic Controller) for controlling an industrial machine or the like installed in a production line of a factory has been known (for example, see Patent Document 1).
The PLC in Patent Document 1 is provided with a CPU unit for controlling the PLC, an input unit to which a signal from a sensor is inputted, and an output unit for outputting a control signal to an industrial machine or the like. The CPU unit has a memory for storing a user program for controlling the industrial machine or the like. This user program is configured so as to be editable by a tool device connected to the CPU unit.
Moreover, in the PLC, a process for acquiring a signal inputted to the input unit in the memory of the CPU unit, a process for executing the user program, a process for writing execution results (operation results) of the user program in the memory and for sending them to the output unit, and a peripheral process for transmitting and receiving data to and from the tool device are executed repeatedly. Thus, the PLC can control an industrial machine or the like based upon an input from the sensor.
Moreover, the PLC of Patent Document 1 is configured such that, when a TRSM command (trace sampling command) included in the user program is executed, the PLC collects variables that have been referenced and updated in the user program. With this configuration, the PLC makes it possible to carry out a data tracing process on a change in a variable caused by the execution of the user program.